1. Field of the Invention
The present invention relates to an apparatus and method for transferring data between address spaces having different structures, as well as to a computer-readable medium storing a computer program therefor. More particularly, the present invention relates to an apparatus and method for transferring data in such an environment where the source and destination address spaces are organized by a plurality of various-sized segments. The invention also relates to a computer-readable medium storing a data transfer program which causes a computer to function as the above apparatus.
2. Description of the Related Art
When transferring data between differently structured address spaces (e.g., computer main memory, input and output channels, external mass storage), it is necessary to properly associate a given source area with its corresponding destination area. To this end, computer systems generally use an address translation table to map one address space to another.
FIG. 11 illustrates a conventional address mapping method. In this example, an address translation table 103 describes how to associate a p-bit wide address space 101 with a q-bit wide address space 102. The two address spaces 101 and 102 are each divided into a plurality of segments with a size of a1. These segments constituting the address spaces 101 and 102 are designated by their respective index numbers xe2x80x9c1-0xe2x80x9d to xe2x80x9c1-nxe2x80x9d and xe2x80x9c2-0xe2x80x9d to xe2x80x9c2-n.xe2x80x9d The address translation table 103 contains a plurality of table entries 103a, which describe how to translate addresses within each segment of the size a1. These table entries have their index numbers xe2x80x9c3-0xe2x80x9d to xe2x80x9c3-n,xe2x80x9d similarly to the address spaces 101 and 102.
Each entry of the address translation table 103 is associated with a particular segment of the address space 102, permitting a given segment in the address space 101 to be mapped to its corresponding part of the address space 102. Take the table entry 103a of index xe2x80x9c3-j,xe2x80x9d for example. Besides storing the index value i of the segment 101a, this table entry 103a is associated with a segment 102a of index xe2x80x9c2-jxe2x80x9d in the address space 102. This setup of the table entry 103a enables the segments 101a to be mapped to the segment 102a. 
The conventional address mapping method is, however, not efficient enough because of its lack of flexibility in handling uneven segment sizes. As previously stated, the conventional method only supports a single segment type. Although the data to be transferred may actually include some blocks that are larger than others, the conventional method cannot handle them as a bulk segment, because the step size of address translation is not allowed to exceed the greatest common divisor of such different block sizes.
Suppose, for example, that the source address space has two portions with different segment sizes a1 and (a1xs), where s is an integer, and data is to be transferred from these two portions to another address space. In this situation, the translation step size of the address translation table must be chosen from among the common divisors of a1 and (a1xs). That is, the translation step size cannot exceed a1, the greatest common divisor of the two segment sizes. Since a mapping occurs at every segment of the size a1, the related hardware and software mechanisms are triggered s times as frequently as in the case where the segment size is (a1xs), being unable to enjoying the advantage of the large source data blocks.
Taking the above into consideration, an object of the present invention is to provide an apparatus which efficiently transfers a plurality of data segments with different sizes.
It is another object of the present invention to provide a method which efficiently transfers a plurality of data segments with different sizes.
To accomplish the first object, according to the present invention, there is provided a data transfer apparatus which transfers data from a first address space to a second address space, where the first and second address spaces are different in data structure. This data transfer apparatus comprises the following elements: an address translation table storage unit, a base address register, a boundary location register, a translation step size register, a translation descriptor domain selector, and a data segment association unit.
The address translation table storage unit stores an address translation table which is organized by a plurality of translation descriptor domains to support a plurality of translation step sizes. The base address register stores base addresses of a plurality of portions of the second address space which are corresponding to the plurality of translation descriptor domains. The boundary location register stores the boundary location of each translation descriptor domain. The translation step size register stores the translation step size that is supported in each translation descriptor domain. The translation descriptor domain selector selects one of the translation descriptor domains that is suitable for mapping a given data segment in the first address space. The data segment association unit associates that data segment in the first address space with another data segment in the second address space, according to the translation step size supported in the translation descriptor domain selected by the translation descriptor domain selector.
To accomplish the second object, according to the present invention, there is provided a method of transferring data from a first address space to a second address space, where the first and second address spaces are different in data structure. This method comprising the following steps: (a) storing an address translation table which is organized by a plurality of translation descriptor domains to support a plurality of translation step sizes; (b) storing base addresses of a plurality of portions of the second address space which are corresponding to the plurality of translation descriptor domains; (c) storing boundary locations of the plurality of translation descriptor domains; (d) storing translation step sizes that are respectively supported in the plurality of translation descriptor domains; (e) selecting one of the translation descriptor domains that is suitable for mapping a data segment in the first address space; and (f) associating the data segment in the first address space with another data segment in the second address space, according to the translation step size supported in the selected translation descriptor domain.
The above and other objects, features and advantages of the present invention will become apparent from the following description when taken in conjunction with the accompanying drawings which illustrate preferred embodiments of the present invention by way of example.